{include file='imobile_header.tpl'}

<div id="topbar">
  <div id="leftnav">
    <a href="user_home.php"><img alt="home" src="./include/imobile/iwebkit/images/home.png" /></a>
  </div> 
  <div id="title"> 
    {lang_print id=11340088}
  </div>
  <div id="bluerightbutton"><a href="javascript:iMobile_toggleFilter('#content','#contentlist');">{lang_print id=11340057}</a></div>
</div>

<div id="content" style="display: none">
	
	<span class="graytitle">{lang_print id=11340059}</span>
	<form action="browse_businesses.php" action="POST">
	<ul class="pageitem"> 
	
    <li class="bigfield">
      <input placeholder="{lang_print id=11290256}" type="text" name="keyword" value="{$keyword}" />
    </li> 
    <li class="bigfield">
      <input placeholder="{lang_print id=11290258}" type="text" name="location" value="{$location}" />
    </li> 
	
		<li class="select">
            <select name="businesscat_id">
              <option value="">{lang_print id=11290096}</option>
              {section name=cat_loop loop=$cats}
                <option value='{$cats[cat_loop].cat_id}' {if $cats[cat_loop].cat_id==$businesscat_id}selected='selected'{/if} class='business_cat_main'>{lang_print id=$cats[cat_loop].cat_title}</option>
                {section name=subcat_loop loop=$cats[cat_loop].subcats}
                   <option value='{$cats[cat_loop].subcats[subcat_loop].subcat_id}' {if $cats[cat_loop].subcats[subcat_loop].subcat_id==$businesscat_id}selected='selected'{/if}> &raquo; {lang_print id=$cats[cat_loop].subcats[subcat_loop].subcat_title}</option> 
                {/section}
              {/section}
            </select>
		</li>
  </ul>		
  {if $setting.setting_business_proximity_search}
  <span class="graytitle">{lang_print id=11290359}</span>
  <ul class="pageitem"> 
		<li class="select">
            <select name="distance">
               <option value=""></option>
               <option value="2" {if $distance==2}selected='selected'{/if}>{lang_sprintf id=11290363 1=2 2=$setting.setting_geo_distance_unit}</option>
               <option value="5" {if $distance==5}selected='selected'{/if}>{lang_sprintf id=11290363 1=5 2=$setting.setting_geo_distance_unit}</option>
               <option value="10" {if $distance==10}selected='selected'{/if}>{lang_sprintf id=11290363 1=10 2=$setting.setting_geo_distance_unit}</option>
               <option value="25" {if $distance==25}selected='selected'{/if}>{lang_sprintf id=11290363 1=25 2=$setting.setting_geo_distance_unit}</option>
               <option value="50" {if $distance==50}selected='selected'{/if}>{lang_sprintf id=11290363 1=50 2=$setting.setting_geo_distance_unit}</option>
               <option value="100" {if $distance==100}selected='selected'{/if}>{lang_sprintf id=11290363 1=100 2=$setting.setting_geo_distance_unit}</option>
            </select>
            
		</li>
		<li class="smallfield">
		  <span class="name">{lang_print id=11290360}</span>
		  <input type="text" name="postal" value="{$postal}" />
    </li>
    {if $proximity_countries|@count > 1}
    <li class="select">
            <select name='cpostal'>
              {foreach from=$proximity_countries item=proximity_country}
              <option value='{$proximity_country}' {if $cpostal == $proximity_country}selected='selected'{/if}>{$proximity_country}</option>
              {/foreach}
            </select>
    </li>
    {/if}
  </ul> 
  {/if}
	
  <span class="graytitle">{lang_print id=11290435}</span>
  <ul class="pageitem"> 
    <li class="smallfield">
      <span class="name">{lang_print id=11290436}</span>
      <input type="text" id="business_fs_city" name="city" value="{$city}"  />
    </li>
    <li class="smallfield">
      <span class="name">{lang_print id=11290437}</span>
      <input type="text" id="business_fs_province" name="province" value="{$province}"  />
    </li>
    <li class="smallfield">
      <span class="name">{lang_print id=11290438}</span>
      <input type="text" id="business_fs_country" name="country" value="{$country}"  />
    </li>
  </ul>
	
  <span class="graytitle">{lang_print id=11290361}</span>
  <ul class="pageitem"> 
    <li class="checkbox"><span class="name">{lang_print id=11290362}</span> 
      <input type="checkbox" name="featured" value="1" {if $featured}checked='checked'{/if} /></li> 
  </ul>
  
    <div class="iButtons">
      <input name="submit" type="submit" value="{lang_print id=11340060}" class="iPush" /></li>
    </div>	
	
	</form>
</div>

<div id="contentlist">


  {if $businesses|@count == 0}
  	
	  <div class="boxinfo"> 
	  	{lang_print id=11290214}
	  </div>  
  {else}
  
	<div id="tributton"> 
		<div class="links"> 
			{if $p != 1}<a href='browse_businesses.php?{$url_query}p={math equation="p-1" p=$p}'>{lang_print id=182}</a>{else}<a href='browse_businesses.php?{$url_query}p=1'>{lang_print id=182}</a>{/if}<a href="browse_businesses.php">Home</a>{if $p != $maxpage}<a href='browse_businesses.php?{$url_query}p={math equation="p+1" p=$p}'>{lang_print id=183}</a>{else}<a href='browse_businesses.php?{$url_query}p={$maxpage}'>{lang_print id=183}</a>{/if}
	    </div> 
	</div>   
  	<div class="page_stats">
	    {if $p_start == $p_end}
	      {lang_sprintf id=184 1=$p_start 2=$total_businesses}
	    {else}
	      {lang_sprintf id=185 1=$p_start 2=$p_end 3=$total_businesses}
	    {/if}
  	</div>
	  <ul class="records">	
	  {section name=business_loop loop=$businesses}
      {assign var=business value=$businesses[business_loop].business}
      {assign var=business_creator value=$businesses[business_loop].business_creator}
	  		<li class="record">
		  		<a href="{$url->url_create('business', $business->business_info.business_slug, $business->business_info.business_id)}">
		  			<img class='photo' src='{$business->business_photo("./images/nophoto.gif", TRUE)}' border='0' />
			        <span class="name">{$business->business_info.business_title}</span>
			        <span class="arrow"></span>
		  		</a>
	  		</li>
	  {/section}
	  </ul>

  {/if}


</div>


{include file='imobile_footer.tpl'}

